﻿/*  
 Copyright 2010 The 'Tribe.Blog' development team  
 (http://tribecache.codeplex.com/team/view)

 This library is licensed under the Ms-PL Microsoft Public License.  You should 
 have received a copy of the license along with the source code.  If not, an online copy
 of the license can be found at http://tribecache.codeplex.com/license.
 
 http://devplanet.com/blogs/brianr/archive/2008/09/26/thread-safe-dictionary-in-net.aspx
 
*/



using System.Threading;

namespace Tribe.Cache.Threading
{
    ///<summary>
    /// Write Lock
    ///</summary>
    internal class WriteLock : BaseLock
    {
        ///<summary>
        /// Constructor
        ///</summary>
        public WriteLock(ReaderWriterLockSlim readerWriterLockSlim)
            : base(readerWriterLockSlim)
        {
            Lock.GetWriteLock(ReaderWriterLockSlim);
        }
        /// <summary>
        /// Dispose
        /// </summary>
        public override void Dispose()
        {
            Lock.ReleaseWriteLock(ReaderWriterLockSlim);
        }
    }
}